/*******************************************************************************
 * Copyright 2011 Google Inc. All Rights Reserved.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *******************************************************************************/
package edu.simis.client;



import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.RootPanel;
import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.TextItem;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.layout.FlowLayout;
import com.google.gwt.user.client.ui.Image;
import com.smartgwt.client.widgets.menu.Menu;
import com.smartgwt.client.widgets.ImgButton;
import com.smartgwt.client.widgets.Img;

import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.tab.Tab;
import com.smartgwt.client.widgets.tab.TabSet;
import com.google.gwt.user.client.ui.Composite;
import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.ButtonItem;
import com.smartgwt.client.widgets.form.fields.FormItem;
import com.smartgwt.client.widgets.form.fields.TextItem;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.layout.FlowLayout;
import com.smartgwt.client.widgets.form.fields.SelectItem;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.TabPanel;


/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class Principal implements EntryPoint {
	public void onModuleLoad() {
		TabPanel tabPanel = new TabPanel();
		final VerticalPanel createEntriesPanel = new VerticalPanel();
		createEntriesPanel.setSize("720px", "400px");
	    createEntriesPanel.setBorderWidth(1);
		FlowLayout flowLayout = new FlowLayout();
		flowLayout.setSize("720px", "488px");
		
		
		final SimisServiceAsync SimisService = (SimisServiceAsync) GWT.create(SimisService.class);
		

		
		createAddCurso(flowLayout);
		createEntriesPanel.add(flowLayout);
		
		
		final RootPanel rootPanel = RootPanel.get();
		
		
		
		Image top = new Image("images/index_r1_c1.jpg");
		rootPanel.add(top, 215, 10);
		top.setSize("842px", "159px");
		
		Image down = new Image("images/down.jpg");
		rootPanel.add(down, 225, 908);
		down.setSize("842px", "51px");
		
		FlowLayout flowLayout2 = new FlowLayout();
		flowLayout2.setSize("187px", "560px");
		
		Menu menu = new Menu();
		flowLayout2.setContextMenu(menu);
		rootPanel.add(flowLayout2, 178, 221);
		
		Image image = new Image("images/add_est.jpg");
		image.addClickHandler(new ClickHandler() {
			
			@Override
			public void onClick(ClickEvent event) {
				
				
			}
		});
		rootPanel.add(image, 178, 221);
		image.setSize("180px", "45px");
		
		
		tabPanel.add(createEntriesPanel,"adicionar curso");
		rootPanel.add(tabPanel, 383, 221);
		tabPanel.setSize("674px", "231px");
		
        
      
	}
	private void createAddCurso(FlowLayout flowLayout){

		
		FlowLayout flowLayout_3 = new FlowLayout();
		flowLayout_3.setSize("705px", "184px");
		
		DynamicForm dynamicForm = new DynamicForm();
		dynamicForm.setGroupTitle("Adicionar Materia");
		dynamicForm.setSize("269px", "178px");
		dynamicForm.setFields(new FormItem[] { new TextItem("Codigo", "*Codigo curso"), new SelectItem("newSelectItem_3", "*Horario"), new SelectItem("newSelectItem_4", "*nobre de la materia"), new TextItem("newTextItem_5", "*Semestre"), new ButtonItem("newButtonItem_5", "Guardar curso")});
		flowLayout_3.addTile(dynamicForm);
		
		FlowLayout flowLayout_4 = new FlowLayout();
		flowLayout_4.setSize("263px", "176px");
		
		Label lblNewLabel = new Label("Ingrese el codigo del curso.");
		lblNewLabel.setSize("187px", "16px");
		flowLayout_4.addTile(lblNewLabel);
		
		Label lblNewLabel_1 = new Label("seleccione el nombre de la materia.");
		lblNewLabel_1.setSize("186px", "15px");
		flowLayout_4.addTile(lblNewLabel_1);
		
		Label lblNewLabel_2 = new Label("selecione el horario de imparticion.");
		lblNewLabel_2.setSize("232px", "16px");
		flowLayout_4.addTile(lblNewLabel_2);
		
		Label lblNewLabel_3 = new Label("Ingrese en semestre al cual pertenece.");
		lblNewLabel_3.setSize("191px", "22px");
		flowLayout_4.addTile(lblNewLabel_3);
		flowLayout_3.addTile(flowLayout_4);
		flowLayout.addTile(flowLayout_3);
		
	}
}

